home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / mobile / fma-2.0-stable-setup.exe / {app} / sframework / plugins / ZoomPlayer.vbs < prev   
Encoding:
Text File  |  2004-09-09  |  4.0 KB  |  161 lines

  1. 'FMA Script Framework Plugin
  2. 'ZoomPlayer
  3. 'Lets you control ZoomPlayer
  4.  
  5. 'TODO:
  6. '-Testing
  7.  
  8. Class ZoomPlayer
  9.     
  10.     Private m_Self
  11.     Private mainMenu
  12.     
  13.     'Some info about the plugin
  14.     Public Property Get SHOWABLE 'Do I have a menu?
  15.         SHOWABLE    = True
  16.     End Property
  17.     Public Property Get TITLE 'What's my name?
  18.         TITLE       = "ZoomPlayer"
  19.     End Property
  20.     Public Property Get DESCRIPTION 'What's my purpose?
  21.         DESCRIPTION = "Lets you control Zoomplayer"
  22.     End Property
  23.     Public Property Get AUTHOR 'Who created me?
  24.         AUTHOR      = "streawkceur (inspired by choroy)"
  25.     End Property
  26.     Public Property Get URL 'Were can I be found? Where can you get more information?
  27.         URL = "http://fma.xinium.com/"
  28.     End Property
  29.     
  30.     'Who am I?
  31.     Public Property Let Self (s)
  32.         m_Self = s
  33.         ' Some init stuff here:
  34.         If IsEmpty(Settings(Me, "Title")) or Settings(Me, "Title") = "" Then Settings(Me, "Title") = "Zoom Player"
  35.         If IsEmpty(Settings(Me, "Exe"))   or Settings(Me, "Exe")   = "" Then Settings(Me, "Exe")   = "C:\Program Files\Zoomplayer\ZPlayer.exe"
  36.         Set mainMenu = New ManagedMenu
  37.         mainMenu.Title = TITLE
  38.     End Property
  39.     Public Property Get Self
  40.         Self = m_Self
  41.     End Property
  42.     
  43.     'Display me. Eventually put a menu on the screen
  44.     Sub Show()
  45.         '--> Init Menu
  46.         Dim llist
  47.         Set llist = New LinkedList
  48.         Dim bi
  49.         bi = llist.BackInserter
  50.         If ZoomPlayerOpen Then
  51.             bi.Item = Array("Play/Pause",    Self & ".Play")
  52.             bi.Item = Array("Stop",          Self & ".Stopp")
  53.             bi.Item = Array("Prev Chapter",  Self & ".PrevChapter")
  54.             bi.Item = Array("Next Chapter",  Self & ".NextChapter")
  55.             bi.Item = Array("Jump ahead",    Self & ".JumpAhead")
  56.             bi.Item = Array("Jump back",     Self & ".JumpBack")
  57.             bi.Item = Array("Volume +",      Self & ".VolumeUp")
  58.             bi.Item = Array("Volume -",      Self & ".VolumeDn")
  59.             bi.Item = Array("(Un)Mute",      Self & ".VolumeMute")
  60.             bi.Item = Array("SubTitles",     Self & ".Subtitles")
  61.             bi.Item = Array("Fullscreen",    Self & ".Fullscreen")
  62.             bi.Item = Array("Fast Fwd",      Self & ".FastForward")
  63.             bi.Item = Array("Rewind",        Self & ".Rewind")
  64.             bi.Item = Array("Close",         Self & ".Close")
  65.         Else
  66.             bi.Item = Array("Launch",        Self & ".Launch")
  67.         End If
  68.         mainMenu.SetList llist
  69.         mainMenu.ShowMenu
  70.     End Sub
  71.     
  72.     Function ZoomPlayerOpen
  73.         ZoomPlayerOpen = Shell.AppActivate(Settings(Me, "Title"))
  74.     End Function
  75.     
  76.     Sub Launch
  77.         If Fso.FileExists(Settings(Me, "Exe")) Then
  78.             Shell.Exec Settings(Me, "Exe")
  79.             Util.WaitForAppLoad Settings(Me, "Title"), 10000 'Give ZoomPlayer max. 10 secs to load
  80.         Else
  81.             Debug.ErrorMsg Self & " - Launch: File not found: " & Settings(Me, "Exe")
  82.         End If
  83.         Show
  84.     End Sub
  85.     
  86.     Sub Close
  87.         If ZoomPlayerOpen Then
  88.             Shell.SendKeys "%x"
  89.             Util.Sleep 3000 'Give ZoomPlayer 3secs to close itself
  90.         End If
  91.         Show
  92.     End Sub
  93.     
  94.     Sub Play
  95.         If ZoomPlayerOpen Then Shell.SendKeys "p"
  96.         am.Update
  97.     End Sub
  98.     
  99.     Sub Stopp
  100.         If ZoomPlayerOpen Then Shell.SendKeys "s"
  101.         am.Update
  102.     End Sub
  103.     
  104.     Sub PrevChapter
  105.         If ZoomPlayerOpen Then Shell.SendKeys "+["
  106.         am.Update
  107.     End Sub
  108.     
  109.     Sub NextChapter
  110.         If ZoomPlayerOpen Then Shell.SendKeys "+]"
  111.         am.Update
  112.     End Sub
  113.     
  114.     Sub JumpAhead
  115.         If ZoomPlayerOpen Then Shell.SendKeys "%."
  116.         am.Update
  117.     End Sub
  118.     
  119.     Sub JumpBack
  120.         If ZoomPlayerOpen Then Shell.SendKeys "%,"
  121.         am.Update
  122.     End Sub
  123.     
  124.     Sub VolumeUp
  125.         If ZoomPlayerOpen Then Shell.SendKeys "+{UP}"
  126.         am.Update
  127.     End Sub
  128.     
  129.     Sub VolumeDn
  130.         If ZoomPlayerOpen Then Shell.SendKeys "+{DOWN}"
  131.         am.Update
  132.     End Sub
  133.     
  134.     Sub VolumeMute
  135.         If ZoomPlayerOpen Then Shell.SendKeys "^m"
  136.         am.Update
  137.     End Sub
  138.     
  139.     Sub Subtitles
  140.         If ZoomPlayerOpen Then Shell.SendKeys "+;"
  141.         am.Update
  142.     End Sub
  143.     
  144.     Sub Fullscreen
  145.         If ZoomPlayerOpen Then Shell.SendKeys "%{ENTER}"
  146.         am.Update
  147.     End Sub
  148.     
  149.     Sub FastForward
  150.         If ZoomPlayerOpen Then Shell.SendKeys "%{HOME}"
  151.         am.Update
  152.     End Sub
  153.     
  154.     Sub Rewind
  155.         If ZoomPlayerOpen Then Shell.SendKeys "%{END}"
  156.         am.Update
  157.     End Sub
  158.     
  159. End Class
  160.  
  161.